package com.iotechn.unimall.admin.api.enterprise;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.AssociationDO;
import com.iotechn.unimall.data.domain.EnterpriseDO;
import com.iotechn.unimall.data.dto.AssociationDTO;
import com.iotechn.unimall.data.dto.EnterpriseDTO;
import com.iotechn.unimall.data.vo.EnterpriseVO;
import com.iotechn.unimall.data.vo.SelectVO;

import java.util.List;

@HttpOpenApi(group = "admin.enterprise", description = "企业管理")
public interface EnterpriseService {

    @HttpMethod(description = "查询Page", permission = "admin:enterprise:page", permissionParentName = "企业列表", permissionName = "企业管理")
    public Page<EnterpriseVO> page(
            @HttpParam(name = "associationId", type = HttpParamType.COMMON, description = "协会id") Long associationId,
            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "企业名称") String name,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页数", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "添加", permission = "admin:enterprise:create", permissionParentName = "企业列表", permissionName = "企业管理")
    public String create(
            @NotNull @HttpParam(name = "enterpriseDTO", type = HttpParamType.COMMON, description = "JSON传输对象") EnterpriseDTO enterpriseDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "admin:enterprise:update", permissionParentName = "企业列表", permissionName = "企业管理")
    public String update(
            @NotNull @HttpParam(name = "enterpriseDTO", type = HttpParamType.COMMON, description = "JSON传输对象") EnterpriseDTO enterpriseDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "admin:enterprise:delete", permissionParentName = "企业列表", permissionName = "企业管理")
    public String delete(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "企业id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "批量删除", permission = "admin:enterprise:batchDelete", permissionParentName = "企业列表", permissionName = "企业管理")
    public String batchDelete(
            @HttpParam(name = "ids", type = HttpParamType.COMMON, description = "企业ids") List ids,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "富文本",  permission = "admin:enterprise:richText", permissionParentName = "企业列表", permissionName = "企业管理")
    public String richText(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "协会id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "下拉企业", permission = "admin:enterprise:enterpriseSelect", permissionParentName = "企业列表", permissionName = "企业管理")
    public List<SelectVO> enterpriseSelect(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "查询企业", permission = "admin:enterprise:queryEnterprise", permissionParentName = "企业列表", permissionName = "企业管理")
    public EnterpriseDO queryEnterprise(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "企业id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
    ) throws ServiceException;

}
